/*
 * GameController.h
 *
 *  Created on: Oct 7, 2011
 *      Author: erudhes
 */

#ifndef GAMECONTROLLER_H_
#define GAMECONTROLLER_H_
#include "IController.h"

class IGameStateController;
class wxString;

// TODO: Add names for the params in the interfaces

/**
 * Base interface for every game controller
 *
 * @see IController
 * @see MainGameController
 * @author Rudolf Heszele heszele@gmail.com
 * @version 1.0
 * @since 2012-03-08
 */
class IGameController: public IController
{
	public:
		/**
		 * Enumeration of possible finish reasons of the game
		 */
		enum FinishReason
		{
			INVALID,
			USER_EXIT,
			RESTART_FROM_USER,
			RESTART_FROM_REMOTE_SIDE,
			CRASHED,
			FINISHED
		};
		IGameController();
		virtual ~IGameController();
		/**
		 * Instruct the controller to start a server
		 *
		 * @param wxString The name of the level
		 * @return true if successfull false on fail
		 */
		virtual bool host(const wxString&) = 0;
		/**
		 * Instructs the controller to join to a server
		 *
		 * @param wxString The name or IP address of the host
		 * @param int The port number
		 */
		virtual bool join(const wxString&, int) = 0;
		/**
		 * Informs the game controller that the configuration has been changed
		 */
		virtual void configurationChange() = 0;
		/**
		 * Instruct the game controller to kick-off the joined client. Can be used only on server side
		 */
		virtual void kickOffClient() = 0;
		/**
		 * Instructs the game controller to finish the game
		 *
		 * @param FinishReason The reason why the game should be finished
		 */
		virtual void finish(FinishReason) = 0;
		/**
		 * Instruct the game controller to change its state
		 *
		 * TODO: Why it is waiting for a normal pointer and not for a SmartPointer?
		 *
		 * @param gameStateController The new state controller
		 */
		virtual void changeState(IGameStateController* gameStateController) = 0;
};


#endif /* GAMECONTROLLER_H_ */
